<template>
  <div class="time-line">
    <u-time-line>
      <u-time-line-item nodeTop="2" v-for="(item,index) in logs" :key="index">
        <template v-slot:content>
          <view>
            <!-- <view class="u-order-title">{{item.operatorType}}</view> -->
            <view class="u-order-desc">{{item.AcceptStation}}</view>
            <view class="u-order-time">{{item.AcceptTime}}</view>
          </view>
        </template>
      </u-time-line-item>
    </u-time-line>
  </div>
</template>

<script>
import { getSellerDeliveryTraces, getAfterSaleTraces } from "@/api/order";
export default {
  data() {
    return {
      routerVal: "",
      logs: [], //订单日志
    };
  },
  onLoad(options) {
    this.routerVal = options;
  },
  onShow() {
    this.init();
  },
  methods: {
    // 根据传值 type来判断  0 /getAfterSaleTraces  1/getSellerDeliveryTraces
    init() {
      console.log(this.routerVal);
      this.routerVal.type == "0"
        ? this.getAfterSaleTracesMethods()
        : this.getSellerDeliveryTracesMethods();
    },
    async getAfterSaleTracesMethods() {
      let {data} = await getAfterSaleTraces(this.routerVal.sn);
      if(data.code==200){
        this.logs=data.result.traces
      }
      //   TODO 样式还没写
    },
    async getSellerDeliveryTracesMethods() {
      let {data} = await getSellerDeliveryTraces(this.routerVal.sn);
      if(data.code==200){
        this.logs=data.result.traces
      }
    },
  },
};
</script>

<style scoped lang="scss">
.time-line {
  padding: 34rpx;
}
.u-node {
  width: 44rpx;
  height: 44rpx;
  border-radius: 100rpx;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #333;
}
.u-order-title {
  color: #333333;
  font-weight: bold;
  font-size: 32rpx;
  margin-bottom: 10rpx;
}

.u-order-desc {
  color: rgb(150, 150, 150);
  font-size: 28rpx;
  margin-bottom: 6rpx;
}

.u-order-time {
  color: rgb(200, 200, 200);
  font-size: 26rpx;
}
</style>